#pragma once

#include "defines.h"
#include "platform/vk/vk_device_context.h"

namespace vkrender
{
    class VulkanUniformBuffer
    {
    public:
        std::shared_ptr<VulkanDeviceContext> context;
        VkBuffer buffer;
        VkDeviceMemory memory;
        void* mapped;

    public:
        VulkanUniformBuffer(
            const std::shared_ptr<VulkanDeviceContext>& context, 
            VkDeviceSize size);

        template<typename T>
        void updateBufferData(const T& data)
        {
            memcpy(mapped, &data, sizeof(T));
        }

    private:
        void createBuffer(VkDeviceSize size);
    };
}
